/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package group2assignone.view.manager;

import group2assignone.func.UCCtoALAdapter;
import group2assignone.model.SaleReport;
import group2assignone.ucm.manager.*;
import group2assignone.view.OurView;
import java.awt.BorderLayout;
import java.util.ArrayList;
import javax.swing.*;
import javax.swing.table.TableColumn;

/**
 *
 * @author Brad
 */
public class SalesReportView extends OurView {

    private JButton done = new JButton("Done");
    private SalesReportTableView table;
    private JTable reportTable;
    private JScrollPane tableScroll = new JScrollPane();

    public SalesReportView(ArrayList<SaleReport> repList) {
        table = new SalesReportTableView(repList);

    }

    @Override
    public void addComponents() {
        reportTable = new JTable(table);
        reportTable.setRowSelectionAllowed(true);
        reportTable.setColumnSelectionAllowed(false);
        reportTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tableScroll = (new JScrollPane(reportTable));



        centerPanel.add(tableScroll);
        southPanel.add(done);

        done.addActionListener(new UCCtoALAdapter(new UCCancelAction(this)));



    }
}
